#include "BuildingManager.h"

#include <SFML/Graphics.hpp>

#include <vector>


BuildingManager::BuildingManager (): buildings ()
{
}

void BuildingManager::addBuilding (BuildingBase* newBuilding)
{

}

BuildingManager& BuildingManager::getInstance ()
{
	static BuildingManager instance;
	return instance;
}

void BuildingManager::clear ()
{
	buildings.clear ();
}

void BuildingManager::updateBuildings (const sf::Time& elapsed)
{
    for(auto& building: buildings)
		building->update (elapsed);
}

bool BuildingManager::processLeftClickEvent (const sf::Vector2i& pos) const
{
    /*for(auto& building: buildings)
		if (building->processLeftClickEvent (pos) == true)
			return true;*/
    return false;
}

bool BuildingManager::processRightClickEvent (const sf::Vector2i& pos) const
{
    /*for(auto& building: buildings)
		if (building->processRightClickEvent (pos) == true)
			return true;*/
    return false;
}

void BuildingManager::draw (sf::RenderTarget& target, sf::RenderStates states) const
{
	for (auto& building: buildings)
		target.draw(*building, states);
}